#include <bits/stdc++.h>
using namespace std;
long long n,a[1000005],b[1000005],cnt=0;
int flg=0;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    int ans=n;
    for(int i=1;i<=n;i++){
        if(a[i+1]>a[i]){
            ans--;
        }
    }
    cout<<ans<<endl;

    fclose(stdin);
    fclose(stdout);
    return 0;

}
